//
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hktk_app/util/font_util.dart';
import 'package:hktk_app/util/sz_util.dart';
import 'package:hktk_app/util/view_util.dart';
import 'package:hktk_app/widget/question/stem_rich_text_widget.dart';

/// 解析组件
class StemAnalysisWidget extends StatelessWidget {
  /// 解析
  final String ana;

  const StemAnalysisWidget({
    super.key,
    required this.ana,
  });

  @override
  Widget build(BuildContext context) {
    debugPrint("stemAnalysisWidget 组件 -> build 方法执行 ===> ");
    debugPrint("");
    return Column(
      children: [
        _titleItem(),
        hiSpace(height: 21),
        StemRichTextWidget(
          text: ana,
        ),
      ],
    );
  }

  /// 标题组件
  _titleItem() {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        SvgPicture.asset(
          "images/question/stem_analysis.svg",
          width: 36,
          height: 29,
        ),
        // _helpButton(),
      ],
    );
  }

  /// 显示帮助按钮
  _helpButton() {
    return GestureDetector(
      onTap: _onTapFunYwt,
      child: Container(
        width: 132,
        height: 48,
        decoration: BoxDecoration(
          color: getColorBlue2(szYjms: szUtilComm.szInfo.yjms),
          borderRadius: BorderRadius.all(Radius.circular(24)),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            SvgPicture.asset(
              "images/question/stem_analysis_help.svg",
              width: 24,
              height: 24,
              color: getColorBlue1(szYjms: szUtilComm.szInfo.yjms),
            ),
            Padding(
              padding: EdgeInsets.only(bottom: 5),
              child: Text(
                "有问题",
                style: FontUtil.fontBlue1(22, szYjms: szUtilComm.szInfo.yjms),
              ),
            ),
          ],
        ),
      ),
    );
  }

  /// 有问题点击方法
  _onTapFunYwt() {
    debugPrint("stemAnalysisWidget 组件 -> 你点击了有问题 ===> ");
  }
}
